package com.moana.job;

import java.util.ArrayList;
import java.util.List;

import com.moana.buyTicket.cache.redis.TicketMapper;
import com.moana.buyTicket.dao.TicketDao;
import com.moana.buyTicket.entity.Ticket;

public class QuartzJob {
	
	TicketDao ticketDao;
	
	public void work(){
		List<Ticket> tickets = ticketDao.readTickets();
/*		List<Ticket> tickets = new ArrayList<Ticket>();
		Ticket ticket = new Ticket();
		ticket.setId(1);
		ticket.setFilmID(1);
		ticket.setLine(1);
		ticket.setRow(1);
		ticket.setStatus(0);
		tickets.add(ticket);*/
		TicketMapper mapper = new TicketMapper();
		mapper.deleteAll();
		mapper.addAll(tickets, 0);		
	}

	public TicketDao getTicketDao() {
		return ticketDao;
	}

	public void setTicketDao(TicketDao ticketDao) {
		this.ticketDao = ticketDao;
	}
	
	
}
